VERSION 5.00
Begin VB.Form VCTSummaryForm 
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   BorderStyle     =   0  'None
   ClientHeight    =   9000
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   12000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   9000
   ScaleWidth      =   12000
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   WindowState     =   2  'Maximized
   Begin VB.CommandButton Cancel_Button 
      BackColor       =   &H008080FF&
      Caption         =   "Cancel"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   7500
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   7920
      Width           =   1935
   End
   Begin VB.CommandButton PrintButton 
      Caption         =   "Print"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9780
      TabIndex        =   3
      Top             =   7920
      Width           =   1935
   End
   Begin VCT.TouchScreenListBox VisitHistoryList 
      Height          =   2355
      Left            =   360
      TabIndex        =   1
      Top             =   720
      Width           =   11355
      _ExtentX        =   20029
      _ExtentY        =   4154
   End
   Begin VCT.VCTSummaryCtrl VCTSummaryCtrl1 
      Height          =   5355
      Left            =   360
      TabIndex        =   0
      Top             =   3240
      Width           =   11475
      _ExtentX        =   20241
      _ExtentY        =   9446
   End
   Begin VB.Label VCTHistoryLabel 
      BackColor       =   &H00FFFFFF&
      Caption         =   "Client VCT History"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   18
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   360
      TabIndex        =   2
      Top             =   240
      Width           =   3495
   End
End
Attribute VB_Name = "VCTSummaryForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim VisitIDArray(20) As String
Dim I As Integer

Private Sub Cancel_Button_Click()
   VCTStageForm.Show
   Unload Me
End Sub

Private Sub Form_Load()

   VCTSummaryCtrl1.Visible = False
   PrintButton.Enabled = False

   CnUser.Open ConnectString
   Cmd.CommandText = "SELECT VDATE, TIMEPRE, VISITID, VISITTYP" _
                  & " FROM   client" _
                  & " WHERE  CLNTCODE = " & CLIENTCO _
                  & " AND (VISITTYP = '1' OR VISITTYP = '2')" _
                  & " AND TIMEPRE IS NOT NULL" _
                  & " ORDER BY TIMEPRE DESC"
   Cmd.CommandType = adCmdText
   Cmd.ActiveConnection = CnUser
   RsUser.Open Cmd, , adOpenStatic
   I = 0
   If RsUser.EOF = False Then
      While RsUser.EOF = False
         If RsUser(3) = "1" Then
            VisitHistoryList.AddItem RsUser(0) & ", " & RsUser(1) & ", Full VCT"
         Else
            If RsUser(3) = "2" Then
               VisitHistoryList.AddItem RsUser(0) & ", " & RsUser(1) & ", Counseling Only"
            Else
               VisitHistoryList.AddItem RsUser(0) & ", " & RsUser(1) & ", Unknown Visit Type"
            End If
         End If
         VisitIDArray(I) = RsUser(2)
         I = I + 1
         RsUser.MoveNext
      Wend
   Else
      VisitHistoryList.AddItem "No record for " & CLIENTCO & " found in the database"
      VisitHistoryList.Enabled = False
   End If
   RsUser.Close
   CnUser.Close
   
End Sub

Private Sub PrintButton_Click()
   PrintTestForm.Show
   Unload Me
End Sub

Private Sub VisitHistoryList_click()
   VISITID = VisitIDArray(VisitHistoryList.ListIndex)
   VCTSummaryCtrl1.UpdateClientDetails
   VCTSummaryCtrl1.Visible = True
   PrintButton.Enabled = True
End Sub
